import chardet


def detect_gbk_encoded(content: bytes) -> bool:
    result = chardet.detect(content)
    print(result)
    if result['encoding'] == 'GBK':
        return True
    else:
        return False

#content = b'\xce\xac\xbf\xcd\xd7\xce\xc4\xd7\xd3\xce\xb5\xd7\xd2\xce\xb1\xd7\xd6\xd5\xce\xb9\xd7\xd5\xd3\xce\xb5\xd7\xd2\xce\xb1'
content = b'\xB0\xA0'
print(detect_gbk_encoded(content))


s = '胡子强胡子强'
new_s = s.encode("gbk")

print(detect_gbk_encoded(new_s))


#print(detect_gbk_encoded(b'\xce\xd2\xc3\xc7'))
